﻿using System.Collections.Generic;
using System.Threading.Tasks;

namespace BaseProject.Domain.Repositories
{
    public interface IBaseRepository<T>
    {
        Task<bool> Insert(T t);

        Task<bool> Update(T t);

        Task<bool> Delete(long id);

        Task<int> Execute(string sql, object param);

        Task<T> GetById(long id);

        Task<IEnumerable<T>> GetList();

        Task<IEnumerable<T>> GetList(string conditions, object param);

        Task<IEnumerable<T>> GetPagedList(int pageNumber, int pageSize, string conditions, string orderby, object param);

        Task<int> RecordCount(string conditions, object param);

        Task<IEnumerable<T>> Query(string sql, object param);

        Task<int> ExecuteScalar(string sql, object param);

        Task<T> QueryFirst(string sql, object param);
    }
}